package com.foreknow.demo9;

import java.util.Iterator;
import java.util.List;

public class Manager {
    public void getStudengtInfo(List<Student> list){
        for (Student stu:list) {
            System.out.println("学号："+stu.getSid()+"\t姓名："+stu.getName()+"\t学校："+stu.getSchool()+"\t电话号码："+stu.getPhone());
        }
        Iterator<Student> it = list.iterator();
        while (it.hasNext()){
            Student s = it.next();
            System.out.println("学号："+s.getSid()+"\t姓名："+s.getName()+"\t学校："+s.getSchool()+"\t电话号码："+s.getPhone());
        }
    }
    public void getSelect(List<Student> list,Integer sid){
        for (Student s:list) {
            if (sid.equals(s.getSid())) {
                System.out.println("学号：" + s.getSid() + "\t姓名：" + s.getName() + "\t学校：" + s.getSchool() + "\t电话号码：" + s.getPhone());
                break;
            }
        }
    }
}
